package cn.Testr;

import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class tiquzifu {
    public static void main(String[] args) {
        System.out.print("请输入字符:");
        String a=new Scanner(System.in).nextLine();
        Map<Character,Integer> a1 = new HashMap<>();
        for (int i = 0; i <a.length() ; i++) {
            char key = a.charAt(i);
            Integer value = a1.get(key);
            if (value==null){
                a1.put(key,1);
            }else {
                a1.put(key, value + 1);
            }
        }
        System.out.println(a1);
    }
}

